package sk.tramtatiri.pages.users;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;

import sk.tramtatiri.core.IConstants;

public class TrackerHomePanel extends UserPageTemplate implements SecuredPage {

	public TrackerHomePanel() {
		configureTabs();
	}

	protected void configureTabs() {
		final List tabs = new ArrayList();

		tabs.add(new AbstractTab(new Model<String>("Vaha a pas")) {

			@Override
			public Panel getPanel(String panelId) {
				return new WeightWaistTrackerPanel(panelId);
			}
		});

		tabs.add(new AbstractTab(new Model<String>("Strava a aktivity")) {

			@Override
			public Panel getPanel(String panelId) {
				return new MealActivityTrackerPanel(panelId);
			}
		});
		
		tabs.add(new AbstractTab(new Model<String>("Odporucania")) {

			@Override
			public Panel getPanel(String panelId) {
				return new RecommendationTrackerPanel(panelId);
			}
		});
		
		tabs.add(new AbstractTab(new Model<String>("Statistiky priatelov")) {

			@Override
			public Panel getPanel(String panelId) {
				return new FriendStatisticsPanel(panelId);
			}
		});
		
		tabs.add(new AbstractTab(new Model<String>("Zdielanie")) {

			@Override
			public Panel getPanel(String panelId) {
				return new SharingPanel(panelId);
			}
		});
		
		final TabbedPanel panel = new TabbedPanel("tabs", tabs);
		add(panel);
	}

	@Override
	public String getPageTitle() {
		return IConstants.PAGE_NAME+" - Tracker Home";
	}

}
